class MemberModel {
  MemberInfo? info;
  List<MemberChannels>? channels;
  List<MemberPrivileges>? privileges;
  MemberBanner? banner;
  MemberOperation? operation;
  MemberFree? free;

  MemberModel(
      {info,
        channels,
        privileges,
        banner,
        operation,
        free});

  MemberModel.fromJson(Map<String, dynamic> json) {
    info = json['info'] != null ? MemberInfo.fromJson(json['info']) : null;
    if (json['channels'] != null) {
      channels = <MemberChannels>[];
      json['channels'].forEach((v) {
        channels!.add(MemberChannels.fromJson(v));
      });
    }
    if (json['privileges'] != null) {
      privileges = <MemberPrivileges>[];
      json['privileges'].forEach((v) {
        privileges!.add(MemberPrivileges.fromJson(v));
      });
    }
    banner =
    json['banner'] != null ? MemberBanner.fromJson(json['banner']) : null;
    operation = json['operation'] != null
        ? MemberOperation.fromJson(json['operation'])
        : null;
    free = json['free'] != null ? MemberFree.fromJson(json['free']) : null;
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    if (info != null) {
      data['info'] = info!.toJson();
    }
    if (channels != null) {
      data['channels'] = channels!.map((v) => v.toJson()).toList();
    }
    if (privileges != null) {
      data['privileges'] = privileges!.map((v) => v.toJson()).toList();
    }
    if (banner != null) {
      data['banner'] = banner!.toJson();
    }
    if (operation != null) {
      data['operation'] = operation!.toJson();
    }
    if (free != null) {
      data['free'] = free!.toJson();
    }
    return data;
  }
}

class MemberInfo {
  int? id;
  String? usercode;
  String? nickname;
  int? gender;
  String? avatar;
  int? longs;
  int? on;
  String? expireDate;
  int? surplus;
  int? vipLevel;
  List<MemberList>? list;

  MemberInfo(
      {id,
        usercode,
        nickname,
        gender,
        avatar,
        longs,
        on,
        expireDate,
        surplus,
        vipLevel,
        list});

  MemberInfo.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    usercode = json['usercode'];
    nickname = json['nickname'];
    gender = json['gender'];
    avatar = json['avatar'];
    longs = json['longs'];
    on = json['on'];
    expireDate = json['expire_date'];
    surplus = json['surplus'];
    vipLevel = json['vip_level'];
    if (json['list'] != null) {
      list = <MemberList>[];
      json['list'].forEach((v) {
        list!.add(MemberList.fromJson(v));
      });
    }
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['usercode'] = usercode;
    data['nickname'] = nickname;
    data['gender'] = gender;
    data['avatar'] = avatar;
    data['longs'] = longs;
    data['on'] = on;
    data['expire_date'] = expireDate;
    data['surplus'] = surplus;
    data['vip_level'] = vipLevel;
    if (list != null) {
      data['list'] = list!.map((v) => v.toJson()).toList();
    }
    return data;
  }
}

class MemberList {
  int? id;
  int? type;
  int? memberType;
  int? accountType;
  String? name;
  String? price;
  String? img;
  String? desc;
  int? vipLevel;
  int? expires;
  int? reward;
  int? status;
  int? recommend;
  String? per;
  int? longs;
  int? level;

  MemberList(
      {id,
        type,
        memberType,
        accountType,
        name,
        price,
        img,
        desc,
        vipLevel,
        expires,
        reward,
        status,
        recommend,
        per,
        longs,
        level});

  MemberList.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    type = json['type'];
    memberType = json['member_type'];
    accountType = json['account_type'];
    name = json['name'];
    price = json['price'];
    img = json['img'];
    desc = json['desc'];
    vipLevel = json['vip_level'];
    expires = json['expires'];
    reward = json['reward'];
    status = json['status'];
    recommend = json['recommend'];
    per = json['per'];
    longs = json['longs'];
    level = json['level'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['id'] = id;
    data['type'] = type;
    data['member_type'] = memberType;
    data['account_type'] = accountType;
    data['name'] = name;
    data['price'] = price;
    data['img'] = img;
    data['desc'] = desc;
    data['vip_level'] = vipLevel;
    data['expires'] = expires;
    data['reward'] = reward;
    data['status'] = status;
    data['recommend'] = recommend;
    data['per'] = per;
    data['longs'] = longs;
    data['level'] = level;
    return data;
  }
}

class MemberChannels {
  int? channelId;
  int? channelType;
  String? channelName;

  MemberChannels({channelId, channelType, channelName});

  MemberChannels.fromJson(Map<String, dynamic> json) {
    channelId = json['channel_id'];
    channelType = json['channel_type'];
    channelName = json['channel_name'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['channel_id'] = channelId;
    data['channel_type'] = channelType;
    data['channel_name'] = channelName;
    return data;
  }
}

class MemberPrivileges {
  String? name;
  String? desc;
  String? icon;
  int? memberType;

  MemberPrivileges({name, desc, icon, memberType});

  MemberPrivileges.fromJson(Map<String, dynamic> json) {
    name = json['name'];
    desc = json['desc'];
    icon = json['icon'];
    memberType = json['member_type'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['name'] = name;
    data['desc'] = desc;
    data['icon'] = icon;
    data['member_type'] = memberType;
    return data;
  }
}

class MemberBanner {
  String? pic;

  MemberBanner({pic});

  MemberBanner.fromJson(Map<String, dynamic> json) {
    pic = json['pic'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['pic'] = pic;
    return data;
  }
}

class MemberOperation {
  int? rankHide;
  int? noGreet;

  MemberOperation({rankHide, noGreet});

  MemberOperation.fromJson(Map<String, dynamic> json) {
    rankHide = json['rank_hide'];
    noGreet = json['no_greet'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['rank_hide'] = rankHide;
    data['no_greet'] = noGreet;
    return data;
  }
}

class MemberFree {
  String? totalNum;
  String? freeNum;

  MemberFree({totalNum, freeNum});

  MemberFree.fromJson(Map<String, dynamic> json) {
    totalNum = json['total_num'];
    freeNum = json['free_num'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = <String, dynamic>{};
    data['total_num'] = totalNum;
    data['free_num'] = freeNum;
    return data;
  }
}
